
import { getRequest, postRequest ,deleteRequest} from '@/lib/axios';
import {
    USER, USERADD, PROJECTLIST, LOGSTYPE, LOGS, UPLOADIMG, METHOD,
    PERMISSION, PERMISSIONDETAIL, PERMISSIONALL, GROUP, GROUPPERMISSION, USERPERMISSION,PASSWORD
} from '@/config/api-constant/system'



// 获取操作类型
export const logsTypeApi = (param) => {
    return getRequest(LOGSTYPE, param)
}

// 获取日志

export const logsApi = (param) => {
    return postRequest(LOGS, param)
}

// 获取用户

export const usersApi = (param) => {
    return postRequest(USER, param)
}

//添加用户

export const usersAddApi = (param) => {
    return postRequest(USERADD, param)
}
// 编辑
export const usersEditApi = (userid, param) => {
    return postRequest(`${USER}/${userid}`, param)
}

// 获取项目列表
export const projectApi = (param) => {
    return getRequest(PROJECTLIST, param)
}

// 获取操作方法列表
export const methodApi = (param) => {
    return getRequest(METHOD, param)
}

// 获取权限列表
export const permissionApi = (param) => {
    return getRequest(PERMISSION, param)
}

// 新增权限列表
export const addPermissionApi = (param) => {
    return postRequest(PERMISSION, param)
}

//编辑权限
export const editePermissionApi = (id,param) => {
    return postRequest(`${PERMISSIONDETAIL}/${id}`, param)
}

//删除权限菜单
export const deletePermissionApi = (id,param) => {
    return deleteRequest(`${PERMISSIONDETAIL}/${id}`, param)
}


//所有权限菜单
export const permissionAllApi = (param) => {
    return getRequest(PERMISSIONALL, param)
}

//权限组列表
export const groupApi = (param) => {
    return getRequest(GROUP, param)
}
//添加权限组
export const addGroupApi = (param) => {
    return postRequest(GROUP, param)
}

//编辑权限组
export const editeGroupApi = (id,param) => {
    return postRequest(`${GROUP}/${id}`, param)
}

//查询组已选权限
export const groupPermissionApi = (id,param) => {
    return getRequest(`${GROUPPERMISSION}/${id}`, param)
}
//设置组权限
export const editeGroupPermissionApi = (id,param) => {
    return postRequest(`${GROUPPERMISSION}/${id}`, param)
}

//管理员权限查询
export const userPermissionApi = (id,param) => {
    return getRequest(`${USERPERMISSION}/${id}`, param)
}

//管理员权限配置
export const editeUserPermissionApi = (id,param) => {
    return postRequest(`${USERPERMISSION}/${id}`, param)
}


// 图片上传
export const uploadimgApi = (param) => {
    return postRequest(UPLOADIMG, param)
}

// 修改密码
export const passwordApi = (param) => {
    return postRequest(PASSWORD, param)
}